home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / dart.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  8KB  |  277 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  3.  
  4. <!-- Dart mode by Chris Sullins
  5. This is a jedit mode file for Dart programming language.
  6. Copyright (C) 2012 Chris Sullins, based on javascript mode by Andre Kaplan
  7.  
  8. This program is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU General Public License
  10. as published by the Free Software Foundation; either version 2
  11. of the License, or (at your option) any later version.
  12.  
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with this program; if not, write to the Free Software
  20. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  21. -->
  22.  
  23. <MODE>
  24.     <PROPS>
  25.         <PROPERTY NAME="commentStart" VALUE="/*" />
  26.         <PROPERTY NAME="commentEnd" VALUE="*/" />
  27.         <PROPERTY NAME="lineComment" VALUE="//" />
  28.         <PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
  29.         
  30.         <!-- Auto indent -->
  31.         <PROPERTY NAME="indentOpenBrackets" VALUE="{[" />
  32.         <PROPERTY NAME="indentCloseBrackets" VALUE="]}" />
  33.         <PROPERTY NAME="unalignedOpenBrackets" VALUE="(" />
  34.         <PROPERTY NAME="unalignedCloseBrackets" VALUE=")" />
  35.         <PROPERTY NAME="indentNextLine"
  36.             VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\(|for\s*\(.*\))[^{;]*)" />
  37.         <PROPERTY NAME="unindentThisLine"
  38.             VALUE="^.*(default:\s*|case.*:.*)$" />
  39.         <PROPERTY NAME="electricKeys" VALUE=":" />
  40.     </PROPS>
  41.     
  42.     <!-- DART string literal where variables get parsed -->
  43.     <RULES SET="DART_LITERAL1" DEFAULT="LITERAL1" ESCAPE="\">
  44.         <!-- expressions in curly braces ("${foo}") -->
  45.         <SPAN_REGEXP HASH_CHAR="$" TYPE="LITERAL4" DELEGATE="DART_EXPRESSION">
  46.             <BEGIN>\$\{</BEGIN>
  47.             <END>}</END>
  48.         </SPAN_REGEXP>
  49.         
  50.         <SEQ_REGEXP HASH_CHAR="$" TYPE="LITERAL4">\$[_a-zA-Z][_a-zA-Z0-9]*</SEQ_REGEXP>
  51.     </RULES>
  52.     
  53.     <RULES SET="DART_EXPRESSION"
  54.         HIGHLIGHT_DIGITS="TRUE"
  55.         DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)">
  56.         
  57.         <SPAN TYPE="COMMENT3">
  58.             <BEGIN>/**</BEGIN>
  59.             <END>*/</END>
  60.         </SPAN>
  61.         
  62.         <SPAN TYPE="COMMENT1">
  63.             <BEGIN>/*</BEGIN>
  64.             <END>*/</END>
  65.         </SPAN>
  66.         
  67.         <SPAN TYPE="LITERAL1">
  68.             <BEGIN>@"""</BEGIN>
  69.             <END>"""</END>
  70.         </SPAN>
  71.         
  72.         <SPAN TYPE="LITERAL1">
  73.             <BEGIN>@'''</BEGIN>
  74.             <END>'''</END>
  75.         </SPAN>
  76.         
  77.         <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
  78.             <BEGIN>@"</BEGIN>
  79.             <END>"</END>
  80.         </SPAN>
  81.         
  82.         <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
  83.             <BEGIN>@'</BEGIN>
  84.             <END>'</END>
  85.         </SPAN>
  86.         
  87.         <SPAN TYPE="LITERAL1" DELEGATE="DART_LITERAL1">
  88.             <BEGIN>"""</BEGIN>
  89.             <END>"""</END>
  90.         </SPAN>
  91.         
  92.         <SPAN TYPE="LITERAL1" DELEGATE="DART_LITERAL1">
  93.             <BEGIN>'''</BEGIN>
  94.             <END>'''</END>
  95.         </SPAN>
  96.         
  97.         <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\" DELEGATE="DART_LITERAL1">
  98.             <BEGIN>"</BEGIN>
  99.             <END>"</END>
  100.         </SPAN>
  101.         
  102.         <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\" DELEGATE="DART_LITERAL1">
  103.             <BEGIN>'</BEGIN>
  104.             <END>'</END>
  105.         </SPAN>
  106.         
  107.         <SEQ TYPE="OPERATOR">=</SEQ>
  108.         <SEQ TYPE="OPERATOR">!</SEQ>
  109.         <SEQ TYPE="OPERATOR">>=</SEQ>
  110.         <SEQ TYPE="OPERATOR"><=</SEQ>
  111.         <SEQ TYPE="OPERATOR">+</SEQ>
  112.         <SEQ TYPE="OPERATOR">-</SEQ>
  113.         <SEQ TYPE="OPERATOR">/</SEQ>
  114.         <SEQ TYPE="OPERATOR">*</SEQ>
  115.         <SEQ TYPE="OPERATOR">></SEQ>
  116.         <SEQ TYPE="OPERATOR"><</SEQ>
  117.         <SEQ TYPE="OPERATOR">%</SEQ>
  118.         <SEQ TYPE="OPERATOR">&</SEQ>
  119.         <SEQ TYPE="OPERATOR">|</SEQ>
  120.         <SEQ TYPE="OPERATOR">^</SEQ>
  121.         <SEQ TYPE="OPERATOR"><<</SEQ>
  122.         <SEQ TYPE="OPERATOR">>>></SEQ>
  123.         <SEQ TYPE="OPERATOR">>></SEQ>
  124.         <SEQ TYPE="OPERATOR">~/</SEQ>
  125.         
  126.         <SEQ TYPE="OPERATOR">.</SEQ>
  127.         <SEQ TYPE="OPERATOR">;</SEQ>
  128.         <SEQ TYPE="OPERATOR">]</SEQ>
  129.         <SEQ TYPE="OPERATOR">[</SEQ>
  130.         <SEQ TYPE="OPERATOR">}</SEQ>
  131.         <SEQ TYPE="OPERATOR">{</SEQ>
  132.         
  133.         <MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
  134.         <SEQ TYPE="OPERATOR">)</SEQ>
  135.         
  136.         <KEYWORDS>
  137.             <!-- literals -->
  138.             <LITERAL2>null</LITERAL2>
  139.             <LITERAL2>true</LITERAL2>
  140.             <LITERAL2>false</LITERAL2>
  141.             
  142.             <!-- types -->
  143.             <KEYWORD3>bool</KEYWORD3>
  144.             <KEYWORD3>int</KEYWORD3>
  145.             <KEYWORD3>double</KEYWORD3>
  146.             <KEYWORD3>num</KEYWORD3>
  147.             <KEYWORD3>void</KEYWORD3>
  148.             
  149.             <!-- stdlib types -->
  150.             <!-- comment out for consistency with user-defined types -->
  151.             <KEYWORD4>AssertionError</KEYWORD4>
  152.             <KEYWORD4>Clock</KEYWORD4>
  153.             <KEYWORD4>Collection</KEYWORD4>
  154.             <KEYWORD4>Comparable</KEYWORD4>
  155.             <KEYWORD4>Date</KEYWORD4>
  156.             <KEYWORD4>Dispatcher</KEYWORD4>
  157.             <KEYWORD4>Duration</KEYWORD4>
  158.             <KEYWORD4>Expect</KEYWORD4>
  159.             <KEYWORD4>FallThroughError</KEYWORD4>
  160.             <KEYWORD4>Function</KEYWORD4>
  161.             <KEYWORD4>HashMap</KEYWORD4>
  162.             <KEYWORD4>HashSet</KEYWORD4>
  163.             <KEYWORD4>Hashable</KEYWORD4>
  164.             <KEYWORD4>Isolate</KEYWORD4>
  165.             <KEYWORD4>Iterable</KEYWORD4>
  166.             <KEYWORD4>Iterator</KEYWORD4>
  167.             <KEYWORD4>LinkedHashMap</KEYWORD4>
  168.             <KEYWORD4>List</KEYWORD4>
  169.             <KEYWORD4>Map</KEYWORD4>
  170.             <KEYWORD4>Match</KEYWORD4>
  171.             <KEYWORD4>Math</KEYWORD4>
  172.             <KEYWORD4>Object</KEYWORD4>
  173.             <KEYWORD4>Pattern</KEYWORD4>
  174.             <KEYWORD4>Promise</KEYWORD4>
  175.             <KEYWORD4>Proxy</KEYWORD4>
  176.             <KEYWORD4>Queue</KEYWORD4>
  177.             <KEYWORD4>ReceivePort</KEYWORD4>
  178.             <KEYWORD4>RegExp</KEYWORD4>
  179.             <KEYWORD4>SendPort</KEYWORD4>
  180.             <KEYWORD4>Set</KEYWORD4>
  181.             <KEYWORD4>StopWatch</KEYWORD4>
  182.             <KEYWORD4>String</KEYWORD4>
  183.             <KEYWORD4>StringBuffer</KEYWORD4>
  184.             <KEYWORD4>Strings</KEYWORD4>
  185.             <KEYWORD4>TimeZone</KEYWORD4>
  186.             <KEYWORD4>TypeError</KEYWORD4>
  187.             
  188.             <!-- stdlib exceptions -->
  189.             <KEYWORD4>BadNumberFormatException</KEYWORD4>
  190.             <KEYWORD4>ClosureArgumentMismatchException</KEYWORD4>
  191.             <KEYWORD4>EmptyQueueException</KEYWORD4>
  192.             <KEYWORD4>Exception</KEYWORD4>
  193.             <KEYWORD4>ExpectException</KEYWORD4>
  194.             <KEYWORD4>IllegalAccessException</KEYWORD4>
  195.             <KEYWORD4>IllegalArgumentException</KEYWORD4>
  196.             <KEYWORD4>IllegalJSRegExpException</KEYWORD4>
  197.             <KEYWORD4>IndexOutOfRangeException</KEYWORD4>
  198.             <KEYWORD4>IntegerDivisionByZeroException</KEYWORD4>
  199.             <KEYWORD4>NoMoreElementsException</KEYWORD4>
  200.             <KEYWORD4>NoSuchMethodException</KEYWORD4>
  201.             <KEYWORD4>NotImplementedException</KEYWORD4>
  202.             <KEYWORD4>NullPointerException</KEYWORD4>
  203.             <KEYWORD4>ObjectNotClosureException</KEYWORD4>
  204.             <KEYWORD4>OutOfMemoryException</KEYWORD4>
  205.             <KEYWORD4>StackOverflowException</KEYWORD4>
  206.             <KEYWORD4>UnsupportedOperationException</KEYWORD4>
  207.             <KEYWORD4>WrongArgumentCountException</KEYWORD4>
  208.             
  209.             <KEYWORD1>is</KEYWORD1>
  210.             <KEYWORD1>implements</KEYWORD1>
  211.             
  212.             <KEYWORD1>const</KEYWORD1>
  213.             <KEYWORD1>new</KEYWORD1>
  214.             <LITERAL2>this</LITERAL2>
  215.             <LITERAL2>super</LITERAL2>
  216.         </KEYWORDS>
  217.     </RULES>
  218.     
  219.     <RULES
  220.         HIGHLIGHT_DIGITS="TRUE"
  221.         DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)"
  222.         IGNORE_CASE="FALSE">
  223.         
  224.         <SEQ TYPE="COMMENT2">//--></SEQ>
  225.         <EOL_SPAN TYPE="COMMENT2">//</EOL_SPAN>
  226.         
  227.         <EOL_SPAN TYPE="KEYWORD2">#!</EOL_SPAN>
  228.         <SEQ TYPE="KEYWORD2">#library</SEQ>
  229.         <SEQ TYPE="KEYWORD2">#import</SEQ>
  230.         <SEQ TYPE="KEYWORD2">#source</SEQ>
  231.         <SEQ TYPE="KEYWORD2">#resource</SEQ>
  232.         
  233.         <KEYWORDS>
  234.             <!-- general keywords -->
  235.             <KEYWORD1>abstract</KEYWORD1>
  236.             <KEYWORD1>assert</KEYWORD1>
  237.             <KEYWORD1>class</KEYWORD1>
  238.             <KEYWORD1>extends</KEYWORD1>
  239.             <KEYWORD1>factory</KEYWORD1>
  240.             <KEYWORD1>get</KEYWORD1>
  241.             <KEYWORD1>import</KEYWORD1>
  242.             <KEYWORD1>interface</KEYWORD1>
  243.             <KEYWORD1>library</KEYWORD1>
  244.             <KEYWORD1>negate</KEYWORD1>
  245.             <KEYWORD1>operator</KEYWORD1>
  246.             <KEYWORD1>set</KEYWORD1>
  247.             <KEYWORD1>source</KEYWORD1>
  248.             <KEYWORD1>static</KEYWORD1>
  249.             <KEYWORD1>typedef</KEYWORD1>
  250.             
  251.             <!-- control keywords -->
  252.             <KEYWORD1>var</KEYWORD1>
  253.             <KEYWORD1>final</KEYWORD1>
  254.             <KEYWORD1>if</KEYWORD1>
  255.             <KEYWORD1>else</KEYWORD1>
  256.             <KEYWORD1>for</KEYWORD1>
  257.             <KEYWORD1>in</KEYWORD1>
  258.             <KEYWORD1>while</KEYWORD1>
  259.             <KEYWORD1>do</KEYWORD1>
  260.             <KEYWORD1>switch</KEYWORD1>
  261.             <KEYWORD1>case</KEYWORD1>
  262.             <KEYWORD1>default</KEYWORD1>
  263.             <KEYWORD1>in</KEYWORD1>
  264.             <KEYWORD1>try</KEYWORD1>
  265.             <KEYWORD1>catch</KEYWORD1>
  266.             <KEYWORD1>finally</KEYWORD1>
  267.             <KEYWORD1>return</KEYWORD1>
  268.             <KEYWORD1>break</KEYWORD1>
  269.             <KEYWORD1>continue</KEYWORD1>
  270.             <KEYWORD1>throw</KEYWORD1>
  271.             <KEYWORD1>assert</KEYWORD1>
  272.         </KEYWORDS>
  273.         
  274.         <IMPORT DELEGATE="DART_EXPRESSION" />
  275.     </RULES>
  276. </MODE>
  277.